


import {apiRequest, oauthRequest} from "@/utils/HttpRequest";



/** 获取当前的用户 GET /api/currentUser */
export async function fetchDataMenuList(options?: { [key: string]: any }) {
  return oauthRequest<API.MenuTreeList>('menu/list', {
    method: 'GET',
    ...(options || {}),
  });
}

export async function findByDataMenuTreeList(options?: { [key: string]: any }) {
  return oauthRequest<API.MenuList>('menu/listTree', {
    method: 'GET',
    ...(options || {}),
  });
}

export async function findByDataMenuListSelect() {
  return oauthRequest<API.BaseArrayDataResult<API.SelectItem>>('menu/listSelect', {
    method: 'GET'
  });
}

export  async function editMenu(params: API.Category){
  return oauthRequest<API.BaseResult>("menu/edit",{
    method: "POST",
    data: params
  })
}












/** 获取当前的用户 GET /api/currentUser */
export async function fetchDataCategoryList(options?: { [key: string]: any }) {
  return apiRequest<API.MenuTreeList>('syscategory/list', {
    method: 'GET',
    ...(options || {}),
  });
}

export async function findByDataCategoryTreeList(options?: { [key: string]: any }) {
  return apiRequest<API.MenuList>('syscategory/listTree', {
    method: 'GET',
    ...(options || {}),
  });
}

export async function findByDataCategoryListSelect() {
  return apiRequest<API.BaseArrayDataResult<API.SelectItem>>('syscategory/listSelect', {
    method: 'GET'
  });
}

export  async function editCategory(params: API.Category){
  return apiRequest<API.BaseResult>("syscategory/edit",{
    method: "POST",
    data: params
  })
}


export async function findByDataCategoryListPageSelect() {
  return apiRequest<API.BaseArrayDataResult<API.SelectItem>>('syscategory/listPageSelect', {
    method: 'GET'
  });
}

